package com.itheima.ssm.dao;

import com.itheima.ssm.domain.Product;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IProductDao {
//    通过id来拿取信息
    @Select("select * from product where id = #{ordersId}")
    public Product findId(int id)throws Exception;

//    查询所有的产品信息
    @Select("select * from product")
    public List<Product> findAll() throws Exception;

//    保存添加商品
    @Insert("insert into product(productNum,productName,cityName,departureTime,productPrice,productDesc,productStatus) " +
            "values(#{productNum},#{productName},#{cityName},#{departureTime},#{productPrice},#{productDesc},#{productStatus})")
    void save(Product product) throws Exception;
}
